import request from '@/utils/request'

// 获取公司部门信息
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
// 根据id获取单个公司部门信息
export function getDepartmentsDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
/**
  * @description: 更新部门数据
  * @param {*} data:form表单数据 但是要有id值
  * @return {*}
  */
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
// 新增部门接口函数
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 删除部门 接口
export function deleteDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
